<template>
    <div id="app">
        <router-view />
    </div>
</template>

<script>
import WebIM from "./utils/WebIM";

export default{
	name: "App",
  beforeMount(){
    const userInfo = localStorage.getItem("userInfo") && JSON.parse(localStorage.getItem("userInfo"));
    if(userInfo){
      const userName = userInfo.userId;
      const password = userInfo.password;
      let options = {
        user: userName,
        pwd: password,
        appKey: WebIM.config.appkey
      };
      WebIM.conn.open(options);
    }
  }
};

</script>

<style>
  body{
    margin: 0;
    color: #666;
    font-size: 14px;
  }


</style>
